home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacGames Sampler
/
PHT MacGames Bundle.iso
/
MacSource Folder
/
Samples from the CD
/
Basic
/
Star Trek Folder
/
MAIN PROGRAM
next >
Wrap
Text File
|
1985-11-11
|
23KB
|
464 lines
5 IF Z$="OK" THEN 10 ELSE RUN "STAR TREK.BOOT"
6 FRE("")
10 CLEAR,25000: CLS:CALL TEXTSIZE(9):CALL TEXTFONT(4):RANDOMIZE(TIMER/4)
20 FOR N% = 0 TO 10: PRINT TAB( 40);"": NEXT N%
30 PRINT TAB (25)" S U P E R S T A R T R E K "
40 FOR N% = 0 TO 10: PRINT TAB( 40);"": NEXT N%
50 FOR N = 1 TO 4000: NEXT N
60 FOR N = 0 TO 30: PRINT : NEXT N: CLS
70 CLEAR,25000
80 Z$ = " "
90 DIM G(8,8),C(9,2),K(3,3),N(3),Z(8,8),D(8)
100 T=INT( RND(1) *20 +20) *100:T0=T:T9=25+INT(RND(1)*10):D0=0:E=3000:E0=E
110 P=10:P0=P:S9=200:S=0:B9=0:K9=0:X$="":X0$=" IS "
120 DEF FN D(D)=SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2)
130 DEF FN R(R)=INT(RND(R)*7.98+1.01)
140 '
150 Q1=FN R(1):Q2=FN R(1):S1=FN R(1):S2=FN R(1)
160 FOR I=1 TO 9:C(I,1)=0:C(I,2)=0: NEXT I
170 C(3,1)=-1:C(2,1)=-1:C(4,1)=-1:C(4,2)=-1:C(5,2)=-1:C(6,2)=-1
180 C(1,2)=1:C(2,2)=1:C(6,1)=1:C(7,1)=1:C(8,1)=1:C(8,2)=1:C(9,2)=1
190 FOR I = 1 TO 8:D(I) = 0: NEXT I
200 A1$ = "NAVSRSLRSPHATORSHEDAMCOMXXX"
210 '
220 '
230 FOR I = 1 TO 8: FOR J = 1 TO 8:K3 = 0:Z(I,J) = 0:R1 = RND (1)
240 IF R1 > .98 THEN K3 = 3:K9 = K9 + 3: GOTO 280
250 IF R1 > .95 THEN K3 = 2:K9 = K9 + 2: GOTO 280
260 IF R1 > .8 THEN K3 = 1:K9 = K9 + 1
270 RANDOMIZE(TIMER/4)
280 B3 = 0: IF RND (1) > .96 THEN B3 = 1:B9 = B9 + 1
290 G(I,J) = K3 * 100 + B3 * 10 + FN R(1): NEXT J: NEXT I: IF K9 > T9 THEN T9 = K9 + 1
300 IF B9 < > 0 THEN 330
310 IF G(Q1,Q2) < 200 THEN G(Q1,Q2) = G(Q1,Q2) + 100:K9 = K9 + 1
320 B9 = 1:G(Q1,Q2) = G(Q1,Q2) + 10:Q1 = FN R(1):Q2 = FN R(1)
330 K7 = K9: IF B9 < > 1 THEN X$ = "S":Z0$ = " ARE "
340 CLS: PRINT:PRINT:PRINT
350 INPUT "PLEASE TYPE YOUR NAME ";N$
360 CLS: PRINT:PRINT:PRINT
370 PRINT "CAPTAIN ";N$;","
380 PRINT "YOUR ORDERS ARE AS FOLLOWS:"
390 PRINT " DESTROY THE ";K9;" KLINGON WARSHIPS WHICH HAVE INVADED THE":PRINT"GALAXY ";
400 PRINT "BEFORE THEY CAN ATTACK FEDERATION HEADQUARTERS";:PRINT" ON STARDATE ";T0 + T9
410 PRINT "THIS GIVES YOU ";T9;" DAYS.":PRINT" THERE ";: IF B9=1 THEN X0$="IS":PRINT X0$; ELSE X0$="ARE":PRINT X0$;
420 PRINT B9;"STARBASE";X$;" IN THE GALAXY FOR ";: PRINT "RESUPPLYING YOUR SHIP."
430 PRINT : PRINT "HIT ANY KEY TO ACCEPT COMMAND ";
440 I = RND (1): I$="":WHILE I$="":I$=INKEY$:WEND: IF I = 13 THEN 440
450 '
460 Z4 = Q1:Z5 = Q2:K3 = 0:B3 = 0:S3 = 0:G5 = 0:D4 = .5 * RND (1):Z(Q1,Q2) = G(Q1,Q2)
470 IF Q1 < 1 OR Q1 > 8 OR Q2 < 1 OR Q2 > 8 THEN 610
480 GOSUB 4070: PRINT : IF T0 < > T THEN 530
490 CLS
500 PRINT "CAPTAIN ";N$;","
510 PRINT "YOUR MISSION BEGINS WITH YOUR STARSHIP"
520 PRINT "LOCATED IN THE GALACTIC QUADRANT, '";G2$;"'.": GOTO 550
530 '
540 GOSUB 8000:PRINT "NOW ENTERING ";G2$;" QUADRANT. . .";
550 PRINT :K3 = INT (G(Q1,Q2) * .01):B3 = INT (G(Q1,Q2) * .1) - 10 * K3
560 S3 = G(Q1,Q2) - 100 * K3 - 10 * B3: IF K3 = 0 THEN 600
570 PRINT "COMBAT AREA CONDITION ";
580 BEEP : PRINT " RED ": BEEP : IF S > 200 THEN 600
590 PRINT " SHIELDS DANGEROUSLY LOW"
600 FOR I = 1 TO 3:K(I,1) = 0:K(I,2) = 0: NEXT I
610 FOR I = 1 TO 3:K(I,3) = 0: NEXT I:Q$ = Z$ + Z$ + Z$ + Z$ + Z$ + Z$ + Z$ + LEFT$ (Z$,17)
620 '
630 '
640 A$ = "<E>":Z1 = S1:Z2 = S2: GOSUB 3850: IF K3 < 1 THEN 670
650 FOR I = 1 TO K3: GOSUB 3820:A$ = "+K+":Z1 = R1:Z2 = R2
660 GOSUB 3850:K(I,1) = R1:K(I,2) = R2:K(I,3) = S9 * (.5 + RND (1)): NEXT I
670 IF B3 < 1 THEN 690
680 GOSUB 3820:A$ = ">!<":Z1 = R1:B4 = R1:Z2 = R2:B5 = R2: GOSUB 3850
690 FOR I = 1 TO S3: GOSUB 3820:A$ = " * ":Z1 = R1:Z2 = R2: GOSUB 3850: NEXT I
700 GOSUB 2810
710 IF S + + E > 10 THEN IF E > 10 OR D(7) = 0 THEN 750
720 CLS: PRINT "** FATAL ERROR ** YOU'VE JUST STRANDED YOUR SHIP IN SPACE CAPTAIN ";N$;"."
730 PRINT "YOU HAVE INSUFFICIENT MANEUVERING ENERGY"
740 PRINT "AND SHIELD CONTROL IS PRESENTLY ": PRINT "INCAPABLE OF CROSS CIRCUITING TO ENGINE ROOM!!": GOTO 2680
750 PRINT "<============================================================================>"
760 BEEP:INPUT "COMMAND ";A$
770 CLS : PRINT:PRINT:PRINT
780 FOR I = 1 TO 9: IF LEFT$ (A$,3) < > MID$ (A1$,3 * I - 2,3) THEN 800
790 ON I GOTO 910,700,1710,1800,1990,2300,2390,3140,2710
800 NEXT I: PRINT "ENTER ONE OF THE FOLLOWING:"
810 PRINT " NAV (TO SET COURSE)"
820 PRINT " SRS (FOR SHORT RANGE SENSOR SCAN)"
830 PRINT " LRS (FOR LONG RANGE SENSOR SCAN)"
840 PRINT " PHA (TO FIRE PHASERS)"
850 PRINT " TOR (TO FIRE PHOTON TORPEDOES)"
860 PRINT " SHE (TO RAISE OR LOWER SHIELDS)"
870 PRINT " DAM (FOR DAMAGE CONTROL REPORTS)"
880 PRINT " COM (TO CALL ON LIBRARY-COMPUTER)"
890 PRINT " XXX (TO RESIGN YOUR COMMAND)": PRINT : GOTO 710
900 '
910 PRINT : PRINT TAB( 9);" 3"
920 PRINT TAB( 9);" 4 . 2"
930 PRINT TAB( 9);" ..."
940 PRINT TAB( 9);" 5 ....... 1"
950 PRINT TAB( 9);" ..."
960 PRINT TAB( 9);" 6 . 8": PRINT
970 PRINT TAB( 9);" 7"
980 PRINT : PRINT TAB( 9);" C O U R S E"
990 PRINT : PRINT : INPUT "COURSE (1-9)";C1: IF C1 = 9 THEN C1 = 1
995 IF C1>=8.5 AND C1<9 THEN C1=8.45
1000 IF C1 > = 1 AND C1 < 9 THEN 1020
1010 PRINT "LT. SULU REPORTS, 'INCORRECT COURSE DATA SIR!'": GOTO 710
1020 X$ = "8": IF D(1) < 0 THEN X$ = "0.2"
1030 PRINT "WARP FACTOR (0-";X$;")";: INPUT W1: CLS: IF D(1) < 0 AND W1 > .2 THEN 1080
1040 IF W1 > 0 AND W1 < = 8 THEN 1090
1050 IF W1 = 0 THEN 710
1060 PRINT "CHIEF ENGINEER SCOTT REPORTS 'THE ENGINES WON'T TAKE WARP ";W1;"!"
1070 GOTO 710
1080 PRINT "WARP ENGINES ARE DAMAGED. MAXIMUM SPEED = WARP 0.2": GOTO 710
1090 N = INT (W1 * 8 + .5): IF E - N > = 0 THEN 1170
1100 PRINT "ENGINEERING REPORTS 'INSUFFICIENT ENERGY AVAILABLE "
1110 PRINT "FOR MANEUVERING AT WARP ";W1;"!'"
1120 IF S < N - E OR D(7) < 0 THEN 710
1130 PRINT "DEFLECTOR CONTROL ROOM ACKNOWLEGES ";S;" UNITS OF ENERGY"
1140 PRINT "PRESENTLY DEPLOYED TO SHIELDS."
1150 GOTO 710
1160 '
1170 FOR I = 1 TO K3: IF K(I,3) = 0 THEN 1200
1180 A$ = " ":Z1 = K(I,1):Z2 = K(I,2): GOSUB 3850: GOSUB 3820
1190 K(I,1) = Z1:K(I,2) = Z2:A$ = "+K+": GOSUB 3850
1200 NEXT I: GOSUB 2560:D1 = 0:D6 = W1: IF W1 > = 1 THEN D6 = 1
1210 FOR I = 1 TO 8: IF D(I) > = 0 THEN 1260
1220 D(I) = D(I) + D6: IF D(I) > - .1 AND D(I) < 0 THEN D(I) = - .1: GOTO 1260
1230 IF D(I) < 0 THEN 1260
1240 IF D1 < > 1 THEN D1 = 1: PRINT "DAMAGE CONTROL REPORT:"
1250 PRINT TAB( 8);:R1 = I: GOSUB 3920: PRINT G2$;" REPAIR COMPLETED."
1260 NEXT I: IF RND (1) > .2 THEN 1330
1270 R1 = FN R(1): IF RND (1) > = .6 THEN 1300
1280 D(R1) = D(R1) - ( RND (1) * 5 + 1): PRINT "DAMAGE CONTROL REPORT:"
1290 GOSUB 3920: PRINT G2$;" DAMAGED": PRINT : GOTO 1330
1300 D(R1) = D(R1) + RND (1) * 3 + 1: PRINT "DAMAGE CONTROL REPORT:"
1310 GOSUB 3920: PRINT G2$;" STATE OF REPAIR IMPROVED": PRINT
1320 '
1330 A$ = " ":Z1 = INT (S1):Z2 = INT (S2): GOSUB 3850
1340 ON ERROR GOTO 1370
1350 X1 = C(C1,1) + (C(C1 + 1,1) - C(C1,1)) * (C1 - INT (C1)):X = S1:Y = S2
1360 X2 = C(C1,2) + (C(C1 + 1,2) - C(C1,2)) * (C1 - INT (C1)):Q4 = Q1:Q5 = Q2
1370 ON ERROR GOTO 0
1380 FOR I = 1 TO N:S1 = S1 + X1:S2 = S2 + X2: IF S1 < 1 OR S1 > = 9 OR S2 < 1 OR S2 > = 9 THEN 1490
1390 S8 = INT (S1) * 24 + INT (S2) * 3 - 26: IF MID$ (C$,S8,2) = "" THEN 1420
1400 S1 = INT (S1 - X1):S2 = INT (S2 - X2): PRINT "WARP ENGINES SHUT DOWN AT ";
1410 PRINT "SECTOR ";S1;",";S2;"DUE TO BAD NAVIGATION": FOR I = 1 TO 2000: NEXT I: CLS : GOTO 1430
1420 NEXT I:S1 = INT (S1):S2 = INT (S2)
1430 A$ = "<E>":Z1 = INT (S1):Z2 = INT (S2): GOSUB 3850: GOSUB 1660:T8 = 1
1440 IF W1 < 1 THEN T8 = .1 * INT (10 * W1)
1450 T = T + T8: IF T > T0 + T9 THEN 2680
1460 '
1470 GOTO 700
1480 '
1490 X = 8 * Q1 + X + N * X1:Y = 8 * Q2 + Y + N * X2:Q1 = INT (X / 8):Q2 = INT (Y / 8):S1 = INT (X - Q1 * 8)
1500 S2 = INT (Y - Q2 * 8): IF S1 = 0 THEN Q1 = Q1 - 1:S1 = 8
1510 IF S2 = 0 THEN Q2 = Q2 - 1:S2 = 8
1520 X5 = 0: IF Q1 < 1 THEN X5 = 1:Q1 = 1:S1 = 1
1530 IF Q1 > 8 THEN X5 = 1:Q1 = 8:S1 = 8
1540 IF Q2 < 1 THEN X5 = 1:Q2 = 1:S2 = 1
1550 IF Q2 > 8 THEN X5 = 1:Q2 = 8:S2 = 8
1560 IF X5 = 0 THEN 1630
1570 PRINT "LT. UHURA REPORTS MESSAGE FROM STARFLEET COMMAND:"
1580 PRINT "'PERMISSION TO ATTEMPT CROSSING OF": PRINT "GALACTIC PERIMETER IS HEREBY *DENIED*": PRINT "CAPTAIN ";N$;"."
1590 PRINT "SHUT DOWN YOUR ENGINES'."
1600 FOR I = 1 TO 4000: NEXT I
1610 PRINT "CHIEF ENGINEER SCOTT REPORTS 'WARP ENGINES SHUT DOWN AT SECTOR ";S1;",";S2: PRINT "OF QUADRANT ";Q1;",";Q2;"'
1620 IF T > T0 + T9 THEN 2680
1630 IF 8 * Q1 + Q2 = 8 * Q4 + Q5 THEN 1430
1640 T = T + 1: GOSUB 1660: GOTO 460
1650 '
1660 E = E - N - 10: IF E > = 0 THEN RETURN
1670 PRINT "SHIELD CONTROL SUPPLIES ENERGY TO COMPLETE THE MANEUVER."
1680 S = S + E:E = 0: IF S < = 0 THEN S = 0
1690 RETURN
1700 '
1710 IF D(3) < 0 THEN PRINT "LONG RANGE SENSORS ARE INOPERABLE": GOTO 710
1720 PRINT "LONG RANGE SCAN FOR QUADRANT ";Q1;",";Q2
1730 O1$ = "-------------------": PRINT O1$
1740 FOR I = Q1 - 1 TO Q1 + 1:N(1) = - 1:N(2) = - 2:N(3) = - 3: FOR J = Q2 - 1 TO Q2 + 1
1750 IF I > 0 AND I < 9 AND J > 0 AND J < 9 THEN N(J - Q2 + 2) = G(I,J):Z(I,J) = G(I,J)
1760 NEXT J: FOR L = 1 TO 3: PRINT ": ";: IF N(L) < 0 THEN PRINT "+++ ";: GOTO 1780
1770 PRINT RIGHT$ ( STR$ (N(L) + 1000),3);" ";
1780 NEXT L: PRINT ":": PRINT O1$: NEXT I: GOTO 710
1790 '
1800 IF D(4) < 0 THEN PRINT "PHASERS INOPERATIVE": GOTO 710
1810 IF K3 > 0 THEN 1830
1820 PRINT "SCIENCE OFFICER SPOCK REPORTS SENSORS SHOW NO ENEMY SHIPS IN THIS QUADRANT": GOTO 710
1830 IF D(8) < 0 THEN PRINT "COMPUTER FAILURE HAMPERS ACCURACY"
1840 PRINT "PHASERS LOCKED ON TARGET;"
1850 PRINT "ENERGY AVAILABLE = ";E;" UNITS"
1860 INPUT "NUMBER OF UNITS TO FIRE";X: IF X < = 0 THEN 710
1870 IF E - X < 0 THEN 1850
1880 E = E - X: IF D(7) < 0 THEN X = X * RND (1)
1890 H1 = INT (X / K3): FOR I = 1 TO 3: IF K(I,3) < = 0 THEN 1970
1900 H = INT ((H1 / FN D(0)) * ( RND (1) + 2)): IF H > .15 * K(I,3) THEN 1920
1910 PRINT "SENSORS SHOW NO DAMAGE TO ENEMY AT ";K(I,1);",";K(I,2): GOTO 1970
1920 K(I,3) = K(I,3) - H: PRINT H;" UNIT HIT ON KLINGON AT SECTOR ";K(I,1);",";K(I,2)
1930 IF K(I,3) < = 0 THEN PRINT "*** KLINGON DESTROYED ***": GOTO 1950
1940 PRINT "SENSORS SHOW ";K(I,3);" UNITS REMAINING": GOTO 1970
1950 K3 = K3 - 1:K9 = K9 - 1:Z1 = K(I,1):Z2 = K(I,2):A$ = " ": GOSUB 3850
1960 K(I,3) = 0:G(Q1,Q2) = G(Q1,Q2) - 100:Z(Q1,Q2) = G(Q1,Q2): IF K9 < = 0 THEN 2770
1970 NEXT I: GOSUB 2560: GOTO 710
1980 '
1990 IF P < - 0 THEN PRINT "ALL PHOTON TORPEDOES EXPENDED": GOTO 710
2000 IF D(5) < 0 THEN PRINT "PHOTON TUBES ARE NOT OPERATIONAL": GOTO 710
2010 INPUT "PHOTON TORPEDO COURSE (1-9)";C1: IF C1 = 9 THEN C1 = 1
2015 IF C1>=8.5 AND C1<9 THEN C1=8.45
2020 IF C1 > = 1 AND C1 < 9 THEN 2050
2030 PRINT "ENSIGN CHEKOV REPORTS, 'INCORRECT COURSE DATA, SIR!"
2040 GOTO 710
2050 X1 = C(C1,1) + (C(C1 + 1,1) - C(C1,1)) * (C1 - INT (C1)):E = E - 2:P = P - 1
2060 X2 = C(C1,2) + (C(C1 + 1,2) - C(C1,2)) * (C1 - INT (C1)):X = S1:Y = S2
2070 PRINT "TORPEDO TRACK:"
2080 X = X + X1:Y = Y + X2:X3 = INT (X + .5):Y3 = INT (Y + .5)
2090 IF X3 < 1 OR X3 > 8 OR Y3 < 1 OR Y3 > 8 THEN 2280
2100 PRINT " ";X3;",";Y3:A$ = " ":Z1 = X:Z2 = Y: GOSUB 4020
2110 IF Z3 < > 0 THEN 2080
2120 A$ = "+K+":Z1 = X:Z2 = Y: GOSUB 4020: IF Z3 = 0 THEN 2170
2130 PRINT "*** KLINGON DESTROYED ***":K3 = K3 - 1:K9 = K9 - 1: IF K9 < = 0 THEN 2770
2140 FOR I = 1 TO 3: IF X3 = K(I,1) AND Y3 = K(I,2) THEN 2160
2150 NEXT I:I = 3
2160 K(I,3) = 0: GOTO 2260
2170 A$ = " * ":Z1 = X:Z2 = Y: GOSUB 4020: IF Z3 = 0 THEN 2190
2180 PRINT "STAR AT ";X3;",";Y3;" ABSORBED TORPEDO ENERGY.": GOSUB 2560: GOTO 710
2190 A$ = ">!<":Z1 = X:Z2 = Y: GOSUB 4020: IF Z3 = 0 THEN 2010
2200 PRINT "*** STARBASE DESTROYED ***":B3 = B3 - 1:B9 = B9 - 1
2210 IF B9 = 0 OR K9 > T - T0 - T9 THEN 2250
2220 PRINT "THAT DOES IT, CAPTAIN ";N$;"!"YOU ARE HEREBY RELIEVED OF COMMAND "
2230 PRINT "AND SENTENCED TO 99 STARDATES AT HARD LABOR ON CYGNUS 12 "
2240 GOTO 2710
2250 PRINT "STARFLEET COMMAND REVIEWING YOUR RECORD TO CONSIDER COURT MARTIAL!":D0 = 0
2260 Z1 = X:Z2 = Y:A$ = " ": GOSUB 3850
2270 G(Q1,Q2) = K3 * 100 + B3 * 10 + S3:Z(Q1,Q2) = G(Q1,Q2): GOSUB 2560: GOTO 710
2280 PRINT "TORPEDO MISSED": GOSUB 2560: GOTO 710
2290 '
2300 IF D(7) < 0 THEN PRINT "SHIELD CONTROL INOPERABLE": GOTO 710
2310 PRINT "ENERGY AVAILABLE = ";E + S: INPUT "NUMBER OF UNITS TO SHIELDS ";X
2320 IF X < 0 OR S = X THEN PRINT "<SHIELDS UNCHANGED>": GOTO 710
2330 IF X < = E + S THEN 2360
2340 PRINT "SHIELD CONTROL REPORTS 'THIS IS NOT THE FEDERATION TREASURY.'"
2350 PRINT "<SHIELDS UNCHANGED>": GOTO 710
2360 E = E + S - X:S = X: PRINT "DEFLECTOR CONTROL ROOM REPORT:"
2370 PRINT "SHIELDS NOW AT "; INT (S);" UNITS": PRINT "PER YOUR ORDER.": GOTO 710
2380 '
2390 IF D(6) > = 0 THEN 2500
2400 PRINT "DAMAGE CONTROL REPORT NOT AVAILABLE": IF D0 = 0 THEN 710
2410 D3 = 0: FOR I = 1 TO 8: IF D(I) < 0 THEN D3 = D3 + .1
2420 NEXT I: IF D3 = 0 THEN 710
2430 PRINT :D3 = D3 + D4: IF D3 > = 1 THEN D3 = .9
2440 PRINT "TECHNICIANS STANDING BY TO EFFECT REPAIRS TO YOUR SHIP;"
2450 PRINT "ESTIMATED TIME TO REPAIR: ";.01 * INT (100 * D3);" STARDATES"
2460 PRINT "WILL YOU AUTHORIZE THE REPAIR ORDER CAPTAIN ";N$;"?";: PRINT "(Y/N)": INPUT A$
2470 IF A$ < > "Y" THEN 710
2480 FOR I = 1 TO 8: IF D(I) < 0 THEN D(I) = 0
2490 NEXT I:T = T + D3 + .1
2500 CLS: PRINT "DEVICE STATE OF REPAIR": FOR R1 = 1 TO 8
2510 PRINT "------------------------------------"
2520 GOSUB 3920: PRINT G2$; LEFT$ (Z$,25 - LEN (G2$)); INT (D(R1) * 100) * .01
2530 NEXT R1: PRINT : IF D0 < > 0 THEN 2410
2540 GOTO 710
2550 '
2560 IF K3 < - 0 THEN RETURN
2570 IF D0 < > 0 THEN PRINT "STARBASE SHIELDS PROTECT THE ENTERPRIZE": RETURN
2580 FOR I = 1 TO 3: IF K(I,3) < = 0 THEN 2660
2590 H = INT ((K(I,3) / FN D(1)) * (2 + RND (1))):S = S - H:K(I,3) = K(I,3) / (3 + RND (0))
2600 PRINT H;" UNIT HIT ON ENTERPRIZE FROM SECTOR ";K(I,1);",";K(I,2)
2610 IF S < = 0 THEN 2690
2620 PRINT " <SHIELDS DOWN TO ";S;" UNITS>": IF H < 20 THEN 2660
2630 IF RND (1) > .6 OR H / S < = .02 THEN 2660
2640 R1 = FN R(1):D(R1) = D(R1) - H / S - .5 * RND (1): GOSUB 3920
2650 PRINT "DAMAGE CONTROL REPORTS '";G2$;" DAMAGED BY THE HIT'"
2660 NEXT I: RETURN
2670 '
2680 PRINT "IT IS STARDATE ";T: GOTO 2710
2690 PRINT : PRINT "THE ENTERPRISE HAS BEEN DESTROYED. THE FEDERATION WILL BE CONQUERED": GOTO 2680
2700 GOTO 2680
2710 PRINT "THERE WERE ";K9;" KLINGON BATTLE CRUISERS LEFT AT THE END OF YOUR MISSION"
2720 PRINT : PRINT : IF B9 = 0 THEN 2760
2730 PRINT "THE FEDERATION IS IN NEED OF A NEW STARSHIP COMMANDER FOR A SIMILAR MISSION--"
2740 PRINT "IF THERE IS A VOLUNTEER, ";
2750 INPUT "LET HIM STEP FORWARD AND ENTER 'AYE'";A$: IF A$ = "AYE" THEN 70
2760 CALL SHOWCURSOR:SYSTEM
2770 PRINT "CONGRATULATIONS, CAPTAIN ";N$;"!": PRINT "THE LAST KLINGON BATTLE CRUISER MENACING ";
2780 PRINT "THE FEDERATION HAS BEEN DESTROYED.": PRINT
2790 PRINT "YOUR EFFICIENCY RATING IS ";1000 * (K7 / (T - T0)) ^ 2: GOTO 2720
2800 '
2810 FOR I = S1 - 1 TO S1 + 1: FOR J = S2 - 1 TO S2 + 1
2820 IF INT (I + .5) < 1 OR INT (I + .5) > 8 OR INT (J + .5) < 1 OR INT (J + .5) > 8 THEN 2840
2830 A$ = ">!<":Z1 = I:Z2 = J: GOSUB 4020: IF Z3 = 1 THEN 2850
2840 NEXT J: NEXT I:D0 = 0: GOTO 2870
2850 D0 = 1:C$ = "DOCKED":E = E0:P = P0
2860 PRINT "SHIELDS DROPPED FOR DOCKING PURPOSES":S = 0: GOTO 2890
2870 IF K3 > 0 THEN C$ = "*RED*": GOTO 2890
2880 C$ = "GREEN": IF E < E0 * .1 THEN C$ = "YELLOW"
2890 IF D(2) > = 0 THEN 2910
2900 PRINT : PRINT "*** SHORT RANGE SENSORS ARE OUT ***": PRINT : RETURN
2910 O1$ = " --- --- --- --- --- --- --- ---": PRINT O1$: FOR I = 1 TO 8
2920 '
2930 FOR J = (I - 1) * 24 + 1 TO (I - 1) * 24 + 22 STEP 3: PRINT " "; MID$ (Q$,J,3);: NEXT J
2940 ON I GOTO 2950,2960,2970,2980,2990,3000,3010,3020
2950 PRINT : GOTO 3030
2960 PRINT : GOTO 3030
2970 PRINT : GOTO 3030
2980 PRINT : GOTO 3030
2990 PRINT : GOTO 3030
3000 PRINT : GOTO 3030
3010 PRINT : GOTO 3030
3020 PRINT
3030 NEXT I: PRINT O1$
3040 PRINT "STARDATE "; INT (T * 10) * .1
3050 PRINT "CONDITION ";C$
3060 PRINT "QUADRANT ";Q1;",";Q2
3070 PRINT "SECTOR ";S1;",";S2
3080 PRINT "PHOTON TORPEDOES "; INT (P)
3090 PRINT "TOTAL ENERGY "; INT (E + S)
3100 PRINT "SHIELDS "; INT (S)
3110 PRINT "KLINGONS REMAINING "; INT (K9)
3120 RETURN
3130 '
3140 IF D(8) < 0 THEN PRINT "COMPUTER DISABLED": GOTO 710
3150 BEEP:INPUT "COMPUTER ACTIVE AND AWAITING COMMAND";A: IF A < 0 THEN 710
3160 CLS
3170 PRINT :H8 = 1: ON A + 1 GOTO 3280,3420,3530,3790,3590,3260
3180 PRINT "FUNCTIONS AVAILABLE FROM COMPUTER:"
3190 PRINT " 0 = CUMULATIVE GALACTIC RECORD"
3200 PRINT " 1 = STATUS REPORT"
3210 PRINT " 2 = PHOTON TORPEDO DATA"
3220 PRINT " 3 = STARBASE NAV DATA"
3230 PRINT " 4 = DIRECTION/DISTANCE CALCULATOR"
3240 PRINT " 5 = GALAXY 'REGION NAME' MAP": PRINT : GOTO 3150
3250 '
3260 H8 = 0:G5 = 1:CLS: PRINT " THE GALAXY": GOTO 4320
3270 '
3280 CLS
3290 PRINT "COMPUTER RECORD OF GALAXY FOR QUADRANT": PRINT : PRINT TAB( 17);Q1;",";Q2
3300 PRINT
3310 PRINT " 1 2 3 4 5 6 7 8"
3320 O1$ = " --- --- --- --- --- --- --- ---"
3330 PRINT O1$: FOR I = 1 TO 8: IF H8 = 0 THEN 3380
3340 FOR J = 1 TO 8
3350 PRINT " ";: IF Z(I,J) = 0 THEN PRINT "+++";: GOTO 3370
3360 PRINT RIGHT$ ( STR$ (Z(I,J) + 1000),3);
3370 NEXT J:PRINT: GOTO 3400
3380 Z4 = I:Z5 = I: GOSUB 4070:J0 = INT (10 - .5 * LEN (G2$)): PRINT TAB( J0);G2$;
3390 Z5 = 5: GOSUB 4070:J0 = INT (35 - .5 * LEN (G2$)): PRINT TAB( J0);G2$
3400 PRINT O1$: NEXT I: GOTO 710
3410 '
3420 PRINT " STATUS REPORT:":X$ = "": IF K9 > 1 THEN X$ = "S"
3430 PRINT "KLINGON";X$;" LEFT: ";K9
3440 PRINT "MISSION MUST BE COMPLETED IN ";.1 * INT ((T0 + T9 - T) * 10);" ";: PRINT "STARDATES"
3450 FOR I = 1 TO 4000: NEXT I
3460 X$ = "S": IF B9 < 2 THEN X$ = "": IF B9 < 1 THEN 3500
3470 PRINT "THE FEDERATION IS MAINTAINING ";B9;" ";: PRINT "STARBASE";X$;" IN THE GALAXY"
3480 FOR I = 1 TO 4000: NEXT I: CLS
3490 GOTO 2390
3500 PRINT "YOUR STUPIDITY HAS LEFT YOU ON YOUR OWN IN THE GALAXY---": FOR I = 1 TO 4000: NEXT I
3510 PRINT "YOU HAVE NO STARBASES LEFT!": FOR I = 1 TO 4000: NEXT I: GOTO 2390
3520 '
3530 IF K3 < = 0 THEN 1820
3540 X$ = "": IF K3 > 1 THEN X$ = "S"
3550 PRINT "FROM ENTERPRIZE TO KLINGON BATTLE CRUISER";X$
3560 H8 = 0: FOR I = 1 TO 3: IF K(I,3) < = 0 THEN 3780
3570 W1 = K(I,1):X = K(I,2)
3580 C1 = S1:A = S2: GOTO 3630
3590 PRINT "DIRECTION/DISTANCE CALCULATOR"
3600 PRINT "YOU ARE AT QUADRANT ";Q1;",";Q2;" SECTOR ";S1;",";S2
3610 PRINT "PLEASE ENTER": INPUT " INITIAL COORDINATES (X,Y)";C1,A
3620 INPUT " FINAL COORDINATES (X,Y)";W1,X
3630 X = X - A:A = C1 - W1: IF X < 0 THEN 3710
3640 IF A < 0 THEN 3730
3650 IF X > 0 THEN 3670
3660 IF A = 0 THEN C1 = 5: GOTO 3680
3670 C1 = 1
3680 IF ABS (A) < = ABS (X) THEN 3700
3690 PRINT "DIRECTION = ";C1 + ((( ABS (A) - ABS (X)) + ABS (A)) / ABS (A)): GOTO 3770
3700 PRINT "DIRECTION = ";C1 + ( ABS (A) / ABS (X)): GOTO 3770
3710 IF A > 0 THEN C1 = 3: GOTO 3740
3720 IF X < > 0 THEN C1 = 5: GOTO 3680
3730 C1 = 7
3740 IF ABS (A) > = ABS (X) THEN 3760
3750 PRINT "DIRECTION = ";C1 + ((( ABS (X) - ABS (A)) + ABS (X)) / ABS (X)): GOTO 3770
3760 PRINT "DIRECTION = ";C1 + ( ABS (X) / ABS (A))
3770 PRINT "DISTANCE = "; SQR (X ^ 2 + A ^ 2): IF H8 = 1 THEN 710
3780 NEXT I: GOTO 710
3790 IF B3 < > 0 THEN PRINT "FROM ENTERPRIZE TO STARBASE:":PRINT"MOVE DECIMAL 1 PLACE";
3795 PRINT" TO THE LEFT WHEN ENTERING INTRASECTOR DISTANCES":W1 = B4:X = B5: GOTO 3580
3800 PRINT "MR. SPOCK REPORTS, 'SENSORS SHOW NO STARBASES IN THIS QUADRANT.": GOTO 710
3810 '
3820 R1 = FN R(1):R2 = FN R(1):A$ = " ":Z1 = R1:Z2 = R2: GOSUB 4020: IF Z3 = 0 THEN 3820
3830 RETURN
3840 '
3850 S8 = INT (Z2 - .5) * 3 + INT (Z1 - .5) * 24 + 1
3860 IF LEN (A$) < > 3 THEN PRINT "ERROR": STOP
3870 IF S8 = 1 THEN Q$ = A$ + RIGHT$ (Q$,189): RETURN
3880 IF S8 = 190 THEN Q$ = LEFT$ (Q$,189) + A$: RETURN
3890 Q$ = LEFT$ (Q$,S8 - 1) + A$ + RIGHT$ (Q$,190 - S8): RETURN
3900 '
3910 '
3920 ON R1 GOTO 3930,3940,3950,3960,3970,3980,3990,4000
3930 G2$ = "WARP ENGINES": RETURN
3940 G2$ = "SHORT RANGE SENSORS": RETURN
3950 G2$ = "LONG RANGE SENSORS": RETURN
3960 G2$ = "PHASER CONTROL": RETURN
3970 G2$ = "PHOTON TUBES": RETURN
3980 G2$ = "DAMAGE CONTROL": RETURN
3990 G2$ = "SHIELD CONTROL": RETURN
4000 G2$ = "LIBRARY-COMPUTER": RETURN
4010 '
4020 Z1 = INT (Z1 + .5):Z2 = INT (Z2 + .5):S8 = (Z2 - 1) * 3 + (Z1 - 1) * 24 + 1:Z3 = 0
4030 IF MID$ (Q$,S8,3) < > A$ THEN RETURN
4040 Z3 = 1: RETURN
4050 '
4060 '
4070 IF Z5 < = 4 THEN ON Z GOTO 4090,4100,4110,4120,4130,4140,4150,4160
4080 GOTO 4170
4090 G2$ = "ANTARES": GOTO 4260
4100 G2$ = "RIGEL": GOTO 4260
4110 G2$ = "PROCYON": GOTO 4260
4120 G2$ = "VEGA": GOTO 4260
4130 G2$ = "CANOPUS": GOTO 4260
4140 G2$ = "ALTAIR": GOTO 4260
4150 G2$ = "SAGITTARIUS": GOTO 4260
4160 G2$ = "POLLUX": GOTO 4260
4170 ON Z4 GOTO 4180,4190,4200,4210,4220,4230,4240,4250
4180 G2$ = "SIRIUS": GOTO 4260
4190 G2$ = "DENEB": GOTO 4260
4200 G2$ = "CAPELLA": GOTO 4260
4210 G2$ = "BETELGEUSE": GOTO 4260
4220 G2$ = "ALDEBARAN": GOTO 4260
4230 G2$ = "REGULUS": GOTO 4260
4240 G2$ = "ARCTURUS": GOTO 4260
4250 G2$ = "SPICA"
4260 IF G5 < > 1 THEN ON Z5 GOTO 4280,4290,4300,4310,4280,4290,4300,4310
4270 RETURN
4280 G2$ = G2$ + " I": RETURN
4290 G2$ = G2$ + " II": RETURN
4300 G2$ = G2$ + " III": RETURN
4310 G2$ = G2$ + " IV": RETURN
4320 PRINT " 1 2 3 4 5 6 7 8"
4330 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4340 PRINT "1 ANTARES SIRIUS"
4350 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4360 PRINT "2 RIGEL DENEB"
4370 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4380 PRINT "3 PROCYON CAPELLA"
4390 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4400 PRINT "4 VEGA BETELGEUSE"
4410 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4420 PRINT "5 CANOPUS ALDEBARAN"
4430 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4440 PRINT "6 ALTAIR REGULUS"
4450 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4460 PRINT "7 SAGITTARIUS ARCTURUS "
4470 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4480 PRINT "8 POLLUX SPICA "
4490 PRINT "---- ---- ---- ---- ---- ---- ---- ----"
4500 GOTO 710
8000 FOR VV=0 TO 1000:NEXT VV:CLS:R%(0)=0:R%(1)=0:R%(2)=400:R%(3)=520
8010 CALL PAINTRECT(VARPTR(R%(0)))
8012 FOR VL=1 TO 120:VX=RND(1)*500:VY=RND(1)*300:LINE(230,140)-(VX,VY),30:NEXT VL
8015 R%(0)=0:R%(1)=0:R%(2)=400:R%(3)=530
8020 BEEP:CALL PAINTRECT(VARPTR(R%(0))):BEEP:CLS
8070 RETURN